package com.xmy.study.service.impl;

import com.xmy.study.constants.MqConstants;
import com.xmy.study.entity.PerStudentClassType;
import com.xmy.study.service.IMqPushService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MqPushServiceImpl implements IMqPushService {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Override
    public boolean updateStudentGradeClassTypeId(PerStudentClassType studentClassType){
        try {
            rabbitTemplate.convertAndSend(MqConstants.EXCHANGE_ERP_STUDENT_GRADE_CLASS_TTYPE_ID_FANOUT, null, studentClassType);
        } catch (Exception e) {
            return false;
        }
        return true;
    }

}
